package edu.ccut.saturn.studio.wfg.dialog.userdialog;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import edu.ccut.saturn.studio.core.util.eclipse.Messages;
import edu.ccut.saturn.studio.database.model.DBConnection;
import edu.ccut.saturn.studio.wfg.dialog.userdialog.treeoperate.TreeDataGenerator;
//import edu.ccut.saturn.studio.wfg.model.DataBaseConnection;

public class DataFactory {

	// 根据传过来的map得到树数据，利用DataBaseConncetion
	@SuppressWarnings("unchecked")
	public static List<OrgnazitionTree> createTreeData(Map<String, String> map,DBConnection connection) {
		
		OrgnazitionTree orgnazitionTree = new OrgnazitionTree(Messages.getString("DataFactory.PaperMulberry"));   //$NON-NLS-1$
		
		List<ISecondTree> listSecond = TreeDataGenerator.getTreeData(connection);
		
		orgnazitionTree.setChildren(listSecond);

		{
			ArrayList<OrgnazitionTree> list = new ArrayList<OrgnazitionTree>();
			list.add(orgnazitionTree);
			return list;
		}
	}
}
